<%@ page contentType="text/html; charset=UTF-8"%>
<%@include file="/html/portlet/chart/admin/init.jsp"%>

<%
	String mvcPath = ParamUtil.getString(request, "mvcPath");

	ResultRow row = (ResultRow) request
			.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);

	Option option = (Option) row.getObject();
%>

<liferay-ui:icon-menu>
	<c:if test='<%= OptionModelPermission.contains(permissionChecker, option, ActionKeys.UPDATE) %>'>
		<portlet:renderURL var="editChartoptionURL">
			<portlet:param name="optionId"
				value="<%=String.valueOf(option.getOptionId()) %>" />
			<portlet:param name="mvcPath"
				value="/html/portlet/chart/admin/edit_chartoption.jsp" />
			<portlet:param name="redirect" value="<%= currentURL %>" />
		</portlet:renderURL>
	
		<liferay-ui:icon image="edit" message="edit"
			url="<%=editChartoptionURL.toString() %>" />
	</c:if>
	<portlet:renderURL var="configTemplateParamValueURL" >
			<portlet:param name="optionId"
				value="<%=String.valueOf(option.getOptionId()) %>" />
			<portlet:param name="mvcPath"
				value="/html/portlet/chart/admin/option/chart.baseconfig.param.jsp" />
			<portlet:param name="redirect" value="<%= currentURL %>" />
	</portlet:renderURL>

	<liferay-ui:icon  message="chart.manage.template.script.param.value" image="tool" url="<%= configTemplateParamValueURL %>" />	
		
	<c:if test='<%= OptionModelPermission.contains(permissionChecker, option, ActionKeys.PERMISSIONS) %>'>
		<liferay-security:permissionsURL
		    modelResource="<%= Option.class.getName() %>"
		    modelResourceDescription="<%= option.getName() %>"
		    resourcePrimKey="<%= String.valueOf(option.getOptionId()) %>"
		    var="permissionsURL" 
		    windowState="<%= LiferayWindowState.POP_UP.toString() %>"
		    />

		<liferay-ui:icon image="permissions" url="<%= permissionsURL %>" useDialog="true"/>		
	</c:if>
	<c:if test='<%= OptionModelPermission.contains(permissionChecker, option, ActionKeys.DELETE) %>'>	
		<portlet:actionURL name="deleteChartOption" var="deleteChartoptionURL">
			<portlet:param name="optionId"
				value="<%= String.valueOf(option.getOptionId()) %>" />
		</portlet:actionURL>

		<liferay-ui:icon-delete url="<%=deleteChartoptionURL.toString() %>" />
	</c:if>
</liferay-ui:icon-menu>